<?php

/**
 * Html form for user login
 *
 * @file
 * @ingroup Templates
 */
/**
 * @defgroup Templates Templates
 */
if (!defined('MEDIAWIKI'))
    die(-1);

/**
 * HTML template for Special:Userlogin form
 * @ingroup Templates
 */
class TemplateMourad extends QuickTemplate {
    
    /**
     *
     * @var type 
     */
    private $user;
    private $rows;
    private $nom;
    
    /**
     *
     * @param type $user
     * @param type $rows 
     */
    function __construct($user, $rows) {
        parent::__construct();
        $this->user = $user;
        $this->rows = $rows;
        $data=array();
    }
    
    /**
     * 
     * @param type $nom 
     */
    public function setNom($nom){
        $this->nom = $nom;
    }
    
    function execute() {
        if($this->user->isLOggedIn()){
            echo "je suis conncté";
        }
        else{
            echo "je ne suis pas connecté";
        }
        
        echo "<br/>";
        
        // ceci est un affichage d'u message se trouvant dans le fichier messageFR.php a l'index 'preview'
        $this->msg('preview')."<br/>";
    ?>
    <form method="POST" action=<?php $this->nom ?>'/index.php?title=Special:Testmourad' />
        <input type="text" name="nom"/>
        <input type="submit" />
    </form>
        nom:<strong><?php echo $this->nom ?></strong><br/>
        <strong><?php $this->msg( 'test-msg' )?></strong>
    <?php
        ?><ul><?php
        foreach($this->rows as $key=>$val){
                echo "<li>".$val->user_name."</li>";
        }
        ?></ul><?php
    }
}
